import request from '@/utils/request'

// 管理员登录
export const adminLoginService = (data) => request.post('/user/adminlogin', data)

// 获取全部用户信息
export const getAllUserInfoService = () => request.get('/admin/getalluserinfo')

// 获取全部管理员信息
export const getAllAdminInfoService = () => request.get('/admin/getalladmininfo')

// 获取全部维修员信息
export const getAllMaintainerInfoService = () => request.get('/admin/getallmaintainerinfo')

// 获取全部订单信息
export const getAllOrderInfoService = () => request.get('/admin/getallorderinfo')

// 修改密码
export const updatePwdService = (oldPwd, newPwd) => request.post('/admin/changepwd', { oldPwd, newPwd })

// 审核维修员
export const checkmaintainerService = (id, status) => request.post('/admin/checkmaintainer', { id, status })

// 添加管理员
export const addAdminService = (data) => request.post('/admin/addadmin', data)

// 修改管理员状态
export const updateAdminService = (id, status, role) => request.post('/admin/updateadmin', { id, status, role })

// 重置密码
export const resetPwdService = (id, role) => request.post('/admin/resetpwd', { id, role })

// 获取统计信息
export const getCountService = () => request.get('/admin/getcount')
